var app = getApp()
var util = require("../../utils/util.js")
var tuiModel = require("../../model/tuiModel.js")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tuiStatus: 1
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
    this.init()
  },
  init() {
    var user = app.data.user
    if (!user) {
      wx.navigateTo({
        url: '../login/login',
      })
    }
    var that=this
    tuiModel.getTuiSetting(res=>{
      that.setData({
        user: user,
        tuiStatus:res.data.status
      })
    })
  },
  //我的预约
  navToUserAppointment(){
    wx.navigateTo({
      url: '../user_appointment/user_appointment',
    })
  }
})